home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / TVPREAD.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  1KB  |  38 lines

  1. /*================================================*/
  2. /* TVPREAD.C                                      */
  3. /*                                                */
  4. /* (c) Copyright 1988 Ralf Brown                  */
  5. /*     All Rights Reserved                        */
  6. /* May be freely copied for noncommercial use as  */
  7. /* long as this copyright notice is kept intact   */
  8. /* and any changes are indicated in the comment   */
  9. /* blocks for the functions                       */
  10. /*================================================*/
  11.  
  12. #include <stdio.h>
  13. #include "tvapi.h"
  14.  
  15. /*================================================*/
  16. /* TVptr_read  read next mouse message            */
  17. /*   Ralf Brown 6/23/88                           */
  18. /*   Ralf Brown 7/21/88 change to use proper msg  */
  19. /*================================================*/
  20.  
  21. int pascal TVptr_read(OBJECT ptr,POINTER_MSG *msg)
  22. {
  23.    PARMLIST2 p ;
  24.  
  25.    if (msg == NULL || !TVisobj(ptr))
  26.       return -1 ;
  27.    p.num_args = 0 ;
  28.    TVsendmsg(READ_MSG, TOS, ptr, (PARMLIST *)&p) ;
  29.    if ((int) p.arg[1] != 5)
  30.       return -1 ;   /* wrong length on message */
  31.    msg->row = ((int far *)p.arg[0])[0] ;
  32.    msg->column = ((int far *)p.arg[0])[1] ;
  33.    msg->button_state = ((BYTE far *)p.arg[0])[4] ;
  34.    return 0 ;  /* successful */
  35. }
  36.  
  37. /* End of TVPREAD.C */
  38.